package com.example.autosize.ext

import com.example.autosize.app.App
import me.jessyan.autosize.utils.AutoSizeUtils
import me.jessyan.autosize.utils.ScreenUtils

/**
 * Created by 舍长 on 2019/4/25
 * describe:屏幕单位获取，转换扩展扩展kt文件
 */
//dp转px
fun dp2px(value: Float) {
    AutoSizeUtils.dp2px(App.getContext(), value)
}

//sp转px
fun sp2px(value: Float) {
    AutoSizeUtils.sp2px(App.getContext(), value)
}

//获取屏幕宽度
fun screenWidth(): Int {
    val screenSize = ScreenUtils.getScreenSize(App.getContext())
    return screenSize[0]//宽度
}

//获取屏幕高度
fun screenHeight(): Int {
    val screenSize = ScreenUtils.getScreenSize(App.getContext())
    return screenSize[1]//高度
}
